<?php
/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license Modified MIT License
 * @link https://blueimp.net/ajax/
 */

class CustomAJAXChat extends AJAXChat {
    public $user;

    public function __construct( $data=array() )
    {
        $this->user = $data;
        $this->getValidLoginUserData();
    }

	// Returns an associative array containing userName, userID and userRole
	// Returns null if login is invalid
	public function getValidLoginUserData() {
        $userID     = $this->user->id_member;
        $userName   = explode(' ', $this->user->name);
        $password   = 'user';
        
        $userData               = array();
        $userData['userID']     = $userID;
        $userData['userName']   = 'user';
        $userData['userRole']   = 'user';
		return $userData;
	}
}